# coding=utf-8
from wtforms import Form, StringField, IntegerField, FloatField
from wtforms.validators import regexp, Length
from wtforms.validators import Email, InputRequired, NumberRange,DataRequired
from sys import maxsize


class AddShopForm(Form):
    name = StringField(
        validators=[DataRequired(message="请输入商店名称!"), Length(0, 50, message='名称长度超过限制！')])
    type_id = IntegerField(validators=[DataRequired(message='必须传入id！')])
    images = StringField(
        validators=[DataRequired(message="请输入图片路径!"), Length(0, 1024, message='名称长度超过限制！')])
    area = StringField(validators=[Length(0, 50, message='名称长度超过限制！')])
    address = StringField(validators=[Length(0, 100, message='名称长度超过限制！')])
    x = FloatField(validators=[DataRequired(message="请输入商店x坐标!")])
    y = FloatField(validators=[DataRequired(message="请输入商店y坐标!")])
    open_hours = StringField(validators=[Length(0, 50, message='内容长度超过限制！')])
    # avg_price = IntegerField(validators=[])
    # sold = IntegerField(validators=[InputRequired(message="请输入店铺销量!")])
    # comments = IntegerField(validators=[InputRequired(message="请输入店铺评论数量!")])


class UpdateShopForm(AddShopForm):
    id = IntegerField(validators=[DataRequired(message='必须传入id！')])


# class TestForm(Form):
#     id = IntegerField(validators=[DataRequired(message='必须传入id！')])
